package com.zheng.sms.rpc.service.impl;


import com.aeye.mbr.common.plugin.mapper.BaseServiceImpl;
import com.aeye.mbr.upms.dao.model.SmsConfig;
import com.zheng.sms.rpc.mapper.SmsConfigMapper;
import com.zheng.sms.rpc.service.SmsConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class SmsConfigServiceImpl extends BaseServiceImpl<SmsConfig> implements SmsConfigService {

    private static Logger log = LoggerFactory.getLogger(SmsConfigServiceImpl.class);

    @Autowired
    SmsConfigMapper configMapper;

    /**
     * 此处可以新增缓存
     * @param topOrgId
     * @return
     */
    @Override
    public SmsConfig getSmsConfig(Integer topOrgId) {
        SmsConfig entity = new SmsConfig();
        entity.setTopOrgId(topOrgId);
        entity.setDisabled(SmsConfig.ENABLE);
        entity = configMapper.selectOne(entity);
        return entity;
    }
}
